import 'package:flutter/material.dart';
import 'package:flutter_getx/app/modules/campus/campus/views/campus_view.dart';
import 'package:flutter_getx/app/modules/msg_list/views/msglist_view.dart';
import 'package:get/get.dart';

import 'package:flutter_getx/app/modules/me/me/views/me_view.dart';
import '../../../data/model/uer_info.dart';
import '../../../service/local_storage_service.dart';
import '../../../service/user_info_service.dart';


class HomeController extends GetxController {
  UserInfoService userInfoService = Get.find();
  LocalStorageService localStorageService = Get.find();


  List<Widget> tabs = [
    MsgListView(),
    MeView(),
    CampusView(),
  ];

  List iconList = [
    {
      'src': 'assets/img/tab/mes.png',
      'title': '消息',
    },
    {
      'src': 'assets/img/tab/me.png',
      'title': '我的',
    },
    {
      'src': 'assets/img/tab/social.png',
      'title': '校园',
    }
  ];

  var currentIndex = 0.obs;

  @override
  void onInit() {
    var str = localStorageService.getData(localStorageService.userInfoKey);

    userInfoService.userInfo.value = UserInfo.fromJson(str);
    super.onInit();
  }

  @override
  void onReady() {


    super.onReady();
  }

  @override
  void onClose() {}
}
